import request from "./request";

export const getBookPriceStat = async ({
                                           frequency,
                                           symbol,
                                           startDate,
                                            endDate
                                       }) => {
    return await request({
        url: `/test_api/book_price_stat?frequency=`+frequency+`&symbol=`+symbol+`&startDate=`+startDate+`&endDate=`+endDate,
        method: 'get'
    });
};

export const getAreaBookStat = async ({
                                           batch_id
                                       }) => {
    return await request({
        url: `/test_api/area_book_stat?batch_id=`+batch_id,
        method: 'get'
    });
};

export const getAllBatches = async () => {
    return await request({
        url: `/test_api/get_all_batches`,
        method: 'get'
    });
};

// 获取每分钟的交易统计
export const getTradesStat = async ({batch_id}) => {
    return await request({
        url: `/test_api/get_trades_stat`,
        method: 'get'
    });
};

// 获取不同交易所的价格对比
export const getPriceCompare = async ({batch_id,
                                          startDate,
                                          endDate}) => {
    return await request({
        url: `/test_api/get_book_stat_list?batch_id=`+batch_id+`&startDate=`+startDate+`&endDate=`+endDate,
        method: 'get'
    });
};

// 获取每五分钟的成交量和价格的走势
export const getTradesIntervalStat = async ({frequency,
                                                symbol,
    startDate,
    endDate}) => {
    return await request({
        url: `/test_api/get_trades_interval_stat?minute=`+frequency+`&symbol=`+symbol+`&startDate=`+startDate+`&endDate=`+endDate,
        method: 'get'
    });
};

// 获取每五分钟的成交量和价格的走势
export const getOhlcv = async () => {
    return await request({
        url: `/test_api/get_ohlcv`,
        method: 'get'
    });
};